package com.zookeeper.t4;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;

/**
 * 作者: LCG
 * 日期: 2020/7/14 11:52
 * 描述:
 */
public class MyWatcher001 implements Watcher {
    @Override
    public void process(WatchedEvent event) {

        //创建事件
        if(event.getType().getIntValue()==Event.EventType.NodeCreated.getIntValue()){
            System.out.println("========创建节点===业务处理===>");
        }else if (event.getType().getIntValue()==Event.EventType.NodeDataChanged.getIntValue()){
            System.out.println("========数据变更===业务处理===>");
        }else if(event.getType().getIntValue()==Event.EventType.NodeChildrenChanged.getIntValue()){
            System.out.println("========子节点变更===业务处理===>");
        }else if(event.getType().getIntValue()==Event.EventType.NodeDeleted.getIntValue()){
            System.out.println("========节点删除===业务处理===>");
        }

    }
}
